import axios from 'axios';

const baseURL = "http://www.lovegf.cn:8899"
/* const baseURL = 'http://www.lovegf.cn:8888/api/private/v1/' */
axios.defaults.baseURL = baseURL;

/* 轮播图 */  

export const  getlunbo = params => {
    return axios.get("/api/getlunbo").then(res=>res)
};

/* 获取新闻资讯 */
export const  getnewslist = params => {
    return axios.get("/api/getnewslist").then(res=>res)
};

/*/* 根据id 获取新闻资讯 */  
export const  getnewsinfo = params => {
    return axios.get(`/api/getnew/${params}`).then(res=>res)
};


/* 获取评论信息 */
export const  getcomments = params => {
    return axios.get(`/api/getcomments/${params.id}?pageindex=${params.pageindex}`).then(res=>res)
};

/* 发布评论 */
export const  postcomment= params => {
    return axios.post("/api/postcomment/"+params.id,{content:params.content}).then(res=>res)
};

/* 图片顶部分类 */
export const  getALlCategory= params => {
    return axios.get("/api/getimgcategory").then(res=>res)
};

/* 图片分类列表 */
export const  getPhotoListByCateId= params => {
    return axios.get(`api/getimages/${params}`).then(res=>res)
};

/* 图片详情 */
export const  getPhotoInfo= params => {
    return axios.get(`/api/getimageInfo/${params}`).then(res=>res)
};

/* 缩略图 */
export const  getThumImages= params => {
    return axios.get(`/api/getthumimages/${params}`).then(res=>res)
};

/* 商品列表 */
export const  goodsList= params => {
    return axios.get('/api/getgoods?pageindex='+params).then(res=>res)
};

/* 商品详情 */
export const  getlunbotu= params => {
    return axios.get(`/api/getthumimages/${params}`).then(res=>res)
};

/*根据id获取 商品详情 */
export const  getGoodsInfo= params => {
    return axios.get(`/api/goods/getinfo/${params}`).then(res=>res)
};

/*根据id获取 商品图文 */
export const  goodsDesc= params => {
    return axios.get(`/api/goods/getdesc/${params}`).then(res=>res)
};

/* 获取购物车列表数据 */
export const  getGoodsList= params => {
    return axios.get(`/api/goods/getshopcarlist/${params}`).then(res=>res)
};